<template>
  <basic-container class="noScrollBar tabMain-wrap">
    <common-template
        ref="detailRef"
        :detailOptions="detailOptions"
        :flowModelId="flowModelId"
        :flowStatus="flowStatus"
        :submitUrl="submitUrl"
        :returnUrl="returnUrl"
        :filePrint="filePrint"
    ></common-template>
  </basic-container>
</template>
<script>
import commonTemplate from "../commonTemplate";
import {getToken} from '@/util/auth';
import flowLogList from "../flowList";
import {
    yqybFormFlowModelId,
    yqybFormSubmit,
    yqybFormReturnSubmit,
    getYqybFormList,
    yqybFormSave,
    yqybFormUpdate,
    yqybFormRemove,
    yqybFormPrint
} from "@/api/sxdky/sxdky";
export default {
  data() {
    return {
      // 流程模型
      flowModelId:yqybFormFlowModelId,
      // 提交URL
      submitUrl:yqybFormSubmit,
      // 驳回URL
      returnUrl:yqybFormReturnSubmit,
      // 文件打印
      filePrint:yqybFormPrint,
      // 流程状态
      flowStatus:true,
      detailOptions: {
      label: "送检申请单",
      name: "deviceFormList",
      options: {
          height: "calc(100vh - 425px)",
          addBtn: true,
          menuDelBtn: false,
          menuUpBtn: false,
          menuDownBtn: true,
          dialogDirection: "ltr",
          dialogType: "drawer",
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          menuForm: false,
          indexLabel: "序号",
          viewBtn: false,
          selection: true,
          excelBtn: false,
          dialogClickModal: false,
          menuOtherBtn: true,
          gistBtn: false,
          align: "center",
          menuAlign: "center",
          searchIcon: true,
          searchIndex: 3,
          labelWidth: 120,
          editBtn: false,
          delBtn: false,
          column: [
            {
                label: "设备名称",
                prop: "deviceName",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
                readonly:true,
                rules: [
                    {
                        required: true,
                        message: "请输入设备名称",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "送检部门",
                prop: "dept",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
                readonly: true
            },
            {
                label: "设备有效期",
                prop: "validPeriod",
                type: "datetime",
                sortable: true,
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                format: "yyyy-MM-dd",
                valueFormat: "yyyy-MM-dd",
                readonly: true,
                rules: [
                    {
                        required: true,
                        message: "请输入设备有效期",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "设备数量",
                prop: "deviceNumber",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                sortable: true,
                controlsPosition: "top",
                readonly: true
            },
            {
                label: "送检单位",
                prop: "planTestDept",
                search: true,
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                rules: [
                    {
                        required: true,
                        message: "请输入送检单位",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "实际送检单位",
                prop: "realTestDept",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
            },
            {
                label: "计划送检时间",
                prop: "planTestTime",
                type: "date",
                sortable: true,
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                format: "yyyy-MM-dd",
                valueFormat: "yyyy-MM-dd",
                rules: [
                    {
                        required: true,
                        message: "请输入计划送检时间",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "实际送检时间",
                prop: "realTestTime",
                type: "date",
                sortable: true,
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                format: "yyyy-MM-dd",
                valueFormat: "yyyy-MM-dd",
            },
            {
                label: "计划检验费用",
                prop: "planTestCost",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
                rules: [
                    {
                        required: true,
                        message: "请输入计划检验费用",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "实际检验费用",
                prop: "realTestCost",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
            },
            {
                label: "提交人",
                prop: "submitName",
                search: true,
                addDisplay:false,
                editDisplay: false,
                viewDisplay: false,
                overHidden: true,
            },
            {
                label: "审批人",
                prop: "flowOperator",
                search: true,
                addDisplay:false,
                editDisplay: false,
                viewDisplay: true,
                overHidden: true,
            },
            {
                label: "处理状态",
                prop: "submitStatus",
                addDisplay:false,
                hide:true,
                editDisplay: false,
                viewDisplay: false,
                overHidden: true,
            },
            {
                label: "处理状态",
                prop: "submitStatus",
                type: "select",
                search: true,
                addDisplay:false,
                editDisplay: false,
                viewDisplay: false,
                dicData: [
                    {
                        label: "新建",
                        value: 0,
                    },
                    {
                        label: "审核中",
                        value: 1,
                    },
                    {
                        label: "已审核",
                        value: 2,
                    },
                    {
                        label: "已退件",
                        value: 3,
                    },
                    {
                        label: "送检前完成",
                        value: 100,
                    },
                ],
            },
          ],
        },
        url: {
          getList: getYqybFormList,
          remove: yqybFormRemove,
          update: yqybFormUpdate,
          add: yqybFormSave,
        },
      },
    };
  },
  components: {
      flowLogList,
      commonTemplate,
  },
  computed: {},
  created() {},
  methods: {},
};
</script>

<style lang='scss'>
.tabMain-wrap {
  // height: calc(100vh - 400px);
  overflow: hidden auto;
}
</style>
